package adapter;

public class Test {
    public static void main(String[] args) {
        RoundHole roundHole = new RoundHole(5.0);
        RoundPeg roundPeg = new RoundPeg(4.0);
        System.out.println("半径" + roundHole.getRadius() + "的圆洞可以装下半径" + roundPeg.getRadius() + "的圆钉吗？：");
        System.out.println(roundHole.fit(roundPeg));
        System.out.println("-----------------------------------------------------");

        SquarePeg squarePeg = new SquarePeg(8.0);
        // roundHole.fit(squarePeg);
        // 类型不符合
        SquarePegAdapter adapter = new SquarePegAdapter(squarePeg);
        System.out.println("半径" + roundHole.getRadius() + "的圆洞可以装下宽" + squarePeg.getWidth() + "的方钉吗？：");
        System.out.println(roundHole.fit(adapter));

    }
}